package org.stars.dao.sqlmapper.macro;

import org.stars.dao.sqlmapper.SqlDefinition;
import org.stars.dao.sqlmapper.SqlMacro;
import org.stars.dao.sqlmapper.SqlMapper;

@MacroDefinition(body=MacroParam.OPTIONAL, evaluation=MacroEvaluation.SOURCE_PROCESSING)
public class Comment extends MacroBase {

	/*
	 * Clear the body. Return an empty string.
	 * 
	 * @see org.stars.dao.sqlmapper.macro.Macro#execute(org.stars.dao.sqlmapper.SqlMapper, org.stars.daostars.core.SqlQuery, java.lang.Object[], java.lang.String)
	 */
	@Override
	public ReturnState execute(SqlMapper sqlMapper, SqlDefinition sqlQuery, SqlMacro sqlMacro) throws Exception {
		log.debug("removed comment");
		sqlMacro.setTemplateText("");
		sqlMacro.getParts().clear();
		return ReturnState.DO_NOTHING;
	}
	
}
